<?php
namespace Admin\Controller;
use Think\Controller;
class IndexController extends Controller {
    public function index(){
        $this->display();
    }
    public function head(){
        $this->display();
    }
    public function left(){
        $admin_id = session('admin_id');
        $admin_name = session('admin_name');
        $admin_info = D('Manager')->find($admin_id);
        $role_id = $admin_info['mg_role_id'];
        
        $role_info = D('role')->find($role_id);
        $auth_ids = $role_info['role_auth_ids'];
        //dump($auth_ids);
        //exit();
        if($admin_name=="admin"){
            $auth_infoA = D('Auth')->where("auth_level=0 ")->select();
            $auth_infoB = D('Auth')->where("auth_level=1 ")->select();
        } else {
            $auth_infoA = D('Auth')->where("auth_level=0 and auth_id in ($auth_ids)")->select();
            $auth_infoB = D('Auth')->where("auth_level=1 and auth_id in ($auth_ids)")->select();
        }
        $this->assign('auth_infoA',$auth_infoA);
        $this->assign('auth_infoB',$auth_infoB);
        //dump($auth_infoB);
        $this->display();
    }
    public function right(){
        $this->display();
    }
}